Make boot-file architecture config distro-aware#788
Merged
Conversation
cwize1
requested changes
Jun 19, 2026
f9cf03b to
9fac01c
Compare
9fac01c to
0d24d64
Compare
createPXEArtifacts calls distroHandler.GetBootArchConfig() but never received a distroHandler parameter, so the package failed to build with 'undefined: distroHandler'. Add distroHandler as the final parameter and pass it from both call sites in liveosisobuilder.go, which already have a distroHandler in scope.
Move the initrd reading helpers into the initrdutils package. Drop the sourceLabel parameter from GetInstalledTargetOsFromEnvFields and let callers add context. Restore the found boolean in GetInstalledTargetOs. Rename bootloaderFilesConfig to bootloaderFilesConfigAzureLinux. Resolve the distro from squashfs presence directly instead of via initramfsTypeFromFilesStore. Add an explicit error check in NewDistroHandlerFromInitrd.
cwize1
approved these changes
Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Boot-file paths and ESP layout are now chosen per distro rather than from a single architecture-only global, and the ISO-to-ISO pipeline detects the distro directly from the initrd.
Previously
getBootArchConfig()was a global that only varied by runtime architecture, so every distro received the same Azure-Linux-style ESP layout. This moves the lookup behind theDistroHandlerinterface so each distro picks its own boot-file layout, and adds a way to identify the distro from an initramfs when no rootfs is mounted.What changed
GetBootArchConfig()to theDistroHandlerinterface. Each distro returns its own per-architecture boot-file map./EFI/BOOTwithBOOTX64.EFI/BOOTAA64.EFI). Azure Linux 2/3, ACL, and Ubuntu keep the existing Azure Linux layout.targetos.GetInitrdTargetOs()andNewDistroHandlerFromInitrd(). These read anos-releaseor dracutinitrd-releasefile straight out of the initramfs cpio, auto-detecting gzip and zstd compression from the stream's magic bytes.getBootArchConfig()withbootArchConfigFromMap()and routed every boot-file lookup (UKI creation, PXE artifacts, ISO artifact store, output artifacts) through the distro handler.Distro to ESP boot-file layout
Checklist